package com.necsv;

import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;

public class SimpleTabActivity extends TabActivity implements OnTabChangeListener
{

	private ViewGroup tabbar;
	private TabHost tabHost;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.simpletab);
		tabbar = (ViewGroup) findViewById(R.id.tabbar);
		tabHost = getTabHost();
		tabHost.setOnTabChangedListener(this);
		setuptab(new Intent(this, CustomDialogActivity.class), getResources().getDrawable(R.drawable.huyen), 0);
		setuptab(new Intent(this, Tutorial1Activity.class), getResources().getDrawable(R.drawable.i141), 0);
		//setuptab(new Intent(this, CustomDialogActivity.class), 0, 0);
	}

	public void onTabChanged(String tabId) {
		// TODO Auto-generated method stub
		
	}
	
	private void setuptab(final Intent intent, Drawable d, int icon) {
		// TODO Auto-generated method stub
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec = tabHost.newTabSpec("tab1");
		spec.setIndicator("sonnt",d );
		spec.setContent(intent);
		tabHost.addTab(spec);
		
	}
		
	
}
